<?php

namespace JLPay\Models\Openmerch\Device;

use JLPay\Models\BaseRequest;

/**
 * 设备添加请求
 */
class DeviceAddRequest extends BaseRequest
{
    /**
     * API URL
     */
    public const API_URL = '/open/merch/access/device/add';

    protected ?string $merchNo = null;
    protected ?string $deviceType = null;
    protected ?string $deviceNo = null;
    protected ?string $printMerchName = null;
    protected ?string $detAddress = null;
    protected ?string $shopId = null;

    /**
     * 设置商户号
     *
     * @param string $merchNo
     * @return self
     */
    public function setMerchNo(string $merchNo): self
    {
        $this->merchNo = $merchNo;
        return $this;
    }

    /**
     * 设置设备类型
     *
     * @param string $deviceType
     * @return self
     */
    public function setDeviceType(string $deviceType): self
    {
        $this->deviceType = $deviceType;
        return $this;
    }

    /**
     * 设置设备号
     *
     * @param string $deviceNo
     * @return self
     */
    public function setDeviceNo(string $deviceNo): self
    {
        $this->deviceNo = $deviceNo;
        return $this;
    }

    /**
     * 设置打印商户名称
     *
     * @param string $printMerchName
     * @return self
     */
    public function setPrintMerchName(string $printMerchName): self
    {
        $this->printMerchName = $printMerchName;
        return $this;
    }

    /**
     * 设置设备地址
     *
     * @param string $detAddress
     * @return self
     */
    public function setDetAddress(string $detAddress): self
    {
        $this->detAddress = $detAddress;
        return $this;
    }

    /**
     * 设置门店ID
     *
     * @param string $shopId
     * @return self
     */
    public function setShopId(string $shopId): self
    {
        $this->shopId = $shopId;
        return $this;
    }

    /**
     * 获取商户号
     *
     * @return string|null
     */
    public function getMerchNo(): ?string
    {
        return $this->merchNo;
    }

    /**
     * 获取设备类型
     *
     * @return string|null
     */
    public function getDeviceType(): ?string
    {
        return $this->deviceType;
    }

    /**
     * 获取设备号
     *
     * @return string|null
     */
    public function getDeviceNo(): ?string
    {
        return $this->deviceNo;
    }

    /**
     * 获取打印商户名称
     *
     * @return string|null
     */
    public function getPrintMerchName(): ?string
    {
        return $this->printMerchName;
    }

    /**
     * 获取设备地址
     *
     * @return string|null
     */
    public function getDetAddress(): ?string
    {
        return $this->detAddress;
    }

    /**
     * 获取门店ID
     *
     * @return string|null
     */
    public function getShopId(): ?string
    {
        return $this->shopId;
    }

    /**
     * 转换为数组
     *
     * @return array
     */
    public function toArray(): array
    {
        $data = parent::toArray();
        $data['merch_no'] = $this->merchNo;
        $data['device_type'] = $this->deviceType;
        $data['device_no'] = $this->deviceNo;
        $data['print_merch_name'] = $this->printMerchName;
        $data['det_address'] = $this->detAddress;
        $data['shop_id'] = $this->shopId;
        return $data;
    }
} 